package com.coderknock.spring.boot.spring.controller;

import com.coderknock.spring.boot.elasticsearch.model.Product;
import com.coderknock.spring.boot.elasticsearch.repository.ProductRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * <p></p>
 *
 * @author 三产
 * @version 1.0
 * @date 2017-07-03
 * @QQGroup 213732117
 * @website http://www.coderknock.com
 * @copyright Copyright 2017 拿客 coderknock.com  All rights reserved.
 * @since JDK 1.8
 */
@Controller
@RequestMapping("/product")
public class ProductController {
    //
    //@Autowired
    //private ProductRepository productRepository;
    //
    //@PostMapping
    //@ResponseBody
    //public Product add(@RequestBody Product product) {
    //    return productRepository.save(product);
    //}
    //
    //@PutMapping("/{productId}")
    //@ResponseBody
    //public Product update(@PathVariable("productId") Long productId, @RequestBody Product product) {
    //    product.setId(productId);
    //    productRepository.save(product);
    //    return product;
    //}
    //
    //@DeleteMapping("/{productId}")
    //public void delete(@PathVariable("productId") Long productId) {
    //    productRepository.delete(productId);
    //}
}